//
//  Top1ViewController.m
//  必争医疗
//
//  Created by 8号球 on 14-11-19.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Top1ViewController.h"

@interface Top1ViewController ()

@end

@implementation Top1ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.Hidden = NO;
    self.tabBarController.tabBar.hidden = YES;
    self.view.backgroundColor = [UIColor grayColor];
    [self creatButtonItem];
    [self creatView];
}
- (void)creatButtonItem
{
    UIButton *bl = [UIButton buttonWithType:UIButtonTypeCustom];
    [bl setTitle:@"我要提问" forState:UIControlStateNormal];
    [bl setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    bl.frame = CGRectMake(0, 0, 80, 30);
    [bl addTarget:self action:@selector(L:) forControlEvents:UIControlEventTouchUpInside];
    UIButton *br = [UIButton buttonWithType:UIButtonTypeCustom];
    [br setTitle:@"提交" forState:UIControlStateNormal];
    [br setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    br.backgroundColor = [UIColor greenColor];
    br.frame = CGRectMake(0, 0, 60, 30);
    [br addTarget:self action:@selector(R:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *left = [[[UIBarButtonItem alloc]initWithCustomView:bl]autorelease];
    UIBarButtonItem *right = [[[UIBarButtonItem alloc]initWithCustomView:br]autorelease];
    self.navigationItem.leftBarButtonItem = left;
    self.navigationItem.rightBarButtonItem = right;
}
- (void)L :(id)sender
{
    [self.navigationController.navigationBar setHidden:YES];
    [self.tabBarController.tabBar setHidden:NO];
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)R :(id)sender
{
    UITextField *tf = (UITextField *)[self.view viewWithTag:11];
    [tf resignFirstResponder];
}
- (void)creatView
{
    UIView *backView = [[[UIView alloc]initWithFrame:CGRectMake(0, 65, 375, 667 - 65)]autorelease];
    UIView *backtf = [[[UIView alloc]initWithFrame:CGRectMake(0, 0, 375, 667 - 65 - 45)]autorelease];
    backtf.backgroundColor = [UIColor whiteColor];
    UITextField *tf = [[[UITextField alloc]initWithFrame:CGRectMake(10, 10, 355, 20)]autorelease];
    tf.placeholder = @"请详细描述出您的年龄，性别，疾病和身体状况，以便得到医生更好地解答。";
    tf.tag = 11;
    UIButton *b1 = [UIButton buttonWithType:UIButtonTypeCustom];
    UIButton *b2 = [UIButton buttonWithType:UIButtonTypeCustom];
    b1.frame = CGRectMake(0, 667 - 65 - 44, 375.0 / 2 - 0.5, 44);
    b2.frame = CGRectMake(375.0 / 2 + 0.5, 667 - 65 - 44, 375.0 / 2 - 0.5, 44);
    b1.backgroundColor = [UIColor whiteColor];
    b2.backgroundColor = [UIColor whiteColor];
    [backView addSubview:backtf];
    [backtf addSubview:tf];
    [backView addSubview:b1];
    [backView addSubview:b2];
    [self.view addSubview:backView];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
